#include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
  int maxScoreSightseeingPair(vector<int> &values)
  {
    int ans = 0;
    int left = values[0];
    for (int i = 1; i < values.size(); i++)
    {
      left -= 1;
      ans = max(ans, left + values[i]);
      left = max(left, values[i]);
    }
    return ans;
  }
};
int main()
{
  Solution s;

  return 0;
}
